package com.core;


import com.core.config.SpringConfig;
import com.core.config.SpringMvcConfig;
import com.core.controller.UserController;
import com.core.dao.TmhDao;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import javax.sql.DataSource;

/**
 * @author tmh
 * @date 2024/4/26 22:01
 * @description
 */
public class App {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        AnnotationConfigApplicationContext mvc = new AnnotationConfigApplicationContext(SpringMvcConfig.class);
//        DataSource bean = ctx.getBean(DataSource.class);
        TmhDao tmhDao = ctx.getBean(TmhDao.class);
        System.out.println(tmhDao.getListUsers());
        System.out.println(mvc.getBean(TmhDao.class));

//        System.out.println(tmhDao.getListUsers());
//        System.out.println(userController.get());
    }
}
